<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta
      name="viewport"
      content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"
    />
    <title>Document</title>
    <style>
      html,
      body {
        margin: 0;
      }
      .box {
        border: 1px solid cyan;
        width: 300px;
        overflow: scroll;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-around;
      }
      .item {
        margin-top: 20px;
        /*使用百分比来设置样式，但是不推荐使用百分比去做适配，因为计算特别的麻烦，因为需要计算每一个元素占父级的比例，而不是页面的比例*/
        width: 33.333333333%;
        height: 50px;
        background-color: red;
        color: white;
        line-height: 50px;
        text-align: center;
        /* border: 1px solid #000; */
      }
    </style>
  </head>
  <body>
    <div class="box">
      <div class="item">1</div>
      <div class="item">2</div>
      <div class="item">3</div>
      <div class="item">4</div>
      <div class="item">5</div>
      <div class="item">6</div>
    </div>

    <script></script>
  </body>
</html>
